package com.bdqn.service.impl;

import com.bdqn.mapper.StorageRecordMapper;
import com.bdqn.pojo.StorageRecord;
import com.bdqn.service.StorageRecordService;
import com.bdqn.util.PageSupport;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("storageRecordService")
public class StorageRecordServiceImpl implements StorageRecordService {
    @Resource
    private StorageRecordMapper storageRecordMapper;

    @Override
    public Long count(String goodsName, Long supplierId) {
        return storageRecordMapper.count(goodsName,supplierId);
    }

    @Override
    public List<StorageRecord> page(String goodsName, Long supplierId,Long payStatus, PageSupport page) {
        Long pageSize =  page.getPageSize();
        Long pageIndex =  ((page.getCurrentPageNo()-1)*pageSize);
        return storageRecordMapper.page(goodsName,supplierId,payStatus,pageIndex,pageSize);
    }


}
